package com.af.security.auth.user.data;

import com.af.data.jpa.entity.AuditorUser;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;

/**
 * @author : zhenyun.su
 * @comment : 为AfAuditorAware提供获取用户的实现
 * 在AfSystemConfigurer注册bean
 * @since : 2022-9-21
 */

public class AfAuditorUser implements AuditorUser {
    @Override
    public String getUserName() {
        return SecurityContextHolder.getContext().getAuthentication().getName();
    }
}
